package com.example.demo.project;

/**
 * 编辑人：刘凯
 */

// 银行服务类
public class BankService {
    private Account account;

    // 创建用户
    public BankService(String accountNumber, String ownerName) {
        account = new Account(accountNumber, ownerName);
    }

    // 保存用户信息
    public void createDeposit(String depositType, double amount, int term) {
        Deposit deposit = new Deposit(account.getAccountNumber(), account.getOwnerName(), depositType, amount, term);
        account.deposit(deposit);
    }


    // 取款方法
    public void withdraw() {
        account.withdraw();
    }

    // 展示信息方法
    public void displayAccountInfo() {
        account.displayAccountInfo();
    }
}